//
// Created by xychen on 2022/1/18.
//

#ifndef THUNDERRAID_GAMEPAGE_H
#define THUNDERRAID_GAMEPAGE_H

#include <QWidget>
#include "gamelevel.h"

class QPushButton;
class QLabel;
class QStackedWidget;

class MainPage: public QWidget{
    Q_OBJECT
public:
    MainPage();
    void reload();

signals:
    void startGame();
    void resumeGame();
    void showHelp();
    void quitGame();

private:
    QPushButton *start, *resume, *help, *exit;
    QLabel *title;
};

class LevelPage: public QWidget{
    Q_OBJECT
public:
    LevelPage();

    void setLevel(const GameLevel &level);

    QLabel *title;
};

class EndPage: public QWidget{
    Q_OBJECT
public:
    EndPage();

    void setState(bool isSuccess, int score);

signals:
    void restartGame();
    void backToMain();
    void quitGame();

private:
    QPixmap success, failed;
    QLabel *status, *score;
    QPushButton *restart;
    QPushButton *back;
    QPushButton *quit;
};

class PausePage : public QWidget{
    Q_OBJECT
public:
    PausePage();

signals:
    void resumeGame();
    void saveGame();
    void endGame();

private:
    QLabel *title;
    QPushButton *resume;
    QPushButton *saveAndQuit;
    QPushButton *quit;
};

class HelpPage: public QWidget{
    Q_OBJECT
public:
    HelpPage();

signals:
    void backToMain();

private:
    QLabel *title;
    QPushButton *back;
};

class DifficultChoicePage: public QWidget{
    Q_OBJECT
public:
    enum Difficult{
        EASY, NORMAL, HARD
    };
    DifficultChoicePage();

signals:
    void selectDifficult(Difficult difficult);

private:
    QLabel *title;
    QPushButton *easy, *normal, *hard;
};


#endif//THUNDERRAID_GAMEPAGE_H
